package com.liuzh.kaoyanspringboot.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.liuzh.kaoyanspringboot.entity.Collect;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 用户文章收藏关联表 Mapper 接口
 * </p>
 *
 * @author 刘志鸿
 * @since 2023-03-15
 */
@Mapper
public interface CollectMapper extends BaseMapper<Collect> {

    Integer selectIdByNameAndUid(@Param("collectName") String collectName,@Param("userId") Integer userId);

    Collect selectByNameAndUid(@Param("collectName") String collectName,@Param("userId") Integer userId);

    List<Integer> selectUserCollectIdList(@Param("userId") Integer userId);

    Page<Collect> findPage(Page<Collect> page,@Param("collectName") String collectName,@Param("username") String username);
}
